<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/echarts.js"></script>
</head>
<body>
    <div id="main" style="width: 800px; height: 500px;"></div>
    <script>
        var Myecharts = echarts.init(document.getElementById("main"));

        option = {
            legend:{
                // left:30,
                data:['直接访问',"邮件营销","联盟广告","视频广告","搜索引擎"],
           },
        //    显示数据
           tooltip: {
                trigger: 'axis'
            },
            xAxis: {
                type: 'category',
                data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
            },
            yAxis: {
                type: 'value'
            },
            series: [{
                name:'直接访问',
                data: [1350, 1200, 800, 280, 200, 180, 50],
                type: 'bar',
                areaStyle:{normal:{}},
                smooth:true,
                stack:"总量",
            },
            {
                name:'邮件营销',
                data: [20, 200, 500, 810, 750, 700, 850],
                type: 'bar',
                areaStyle:{normal:{}},
                smooth:true,
                stack:"总量",
            },
            {
                name:'联盟广告',
                data: [20, 40, 80, 100, 300, 600, 500],
                type: 'bar',
                areaStyle:{normal:{}},
                smooth:true,
                stack:"总量",
            },
            {
                name:'视频广告',
                data: [56, 99, 656, 32, 54, 656, 133],
                type: 'bar',
                areaStyle:{normal:{}},
                smooth:true,
                stack:"总量",
            },
            {
                name:'搜索引擎',
                data: [623, 659, 562, 323, 252, 212, 522],
                type: 'bar',
                areaStyle:{normal:{}},
                smooth:true,
                stack:"总量",
            }],
           
        };

        //    渲染图表
        Myecharts.setOption(option);



    </script>
</body>
</html>